package com.springapp.domain;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by 雪峰 on 2016/3/19.
 */
public class LoginLog implements Serializable {
    private int loginLogId;
    private int userId;
    private String ip;
    private Date loginDate;

    public int getLoginLogId() {
        return loginLogId;
    }

    public void setLoginLogId(int loginLogId) {
        this.loginLogId = loginLogId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LoginLog loginLog = (LoginLog) o;

        if (loginLogId != loginLog.loginLogId) return false;
        if (userId != loginLog.userId) return false;
        if (ip != null ? !ip.equals(loginLog.ip) : loginLog.ip != null) return false;
        if (loginDate != null ? !loginDate.equals(loginLog.loginDate) : loginLog.loginDate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = loginLogId;
        result = 31 * result + userId;
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (loginDate != null ? loginDate.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "LoginLog{" +
                "loginLogId=" + loginLogId +
                ", userId=" + userId +
                ", ip='" + ip + '\'' +
                ", loginDate=" + loginDate +
                '}';
    }
}

